package com.mzpai.web.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mzpai.product.model.ShippingTemplates;
import com.mzpai.product.service.ShippingTemplatesService;
import com.mzpai.vo.ResponseVo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
 *
 * <b>商品快递模板 | Controller</b><br>
 *
 * yanglijun 2021-03-25 08:22:37
 * 
 *  @version 1.0.0
 *
 */
@Api(value = "商品快递模板接口")
@Controller
@RequestMapping("/shippingTemplates")
public class ShippingTemplatesController extends BaseController {

	@Autowired 
	private ShippingTemplatesService shippingTemplatesService;
	private static Logger log = LoggerFactory.getLogger(ShippingTemplatesController.class);
	/** 
	*
	* 查询列表 
	* @throws Exception
	*/
	@ApiOperation(value = "根据门店ID，获取商品快递模板接口")
	@RequestMapping("/getTemplateList")
	@ResponseBody
	public ResponseVo<List<ShippingTemplates>> getList(@RequestParam(value = "storeId", required = true) String storeId) throws Exception {
		ResponseVo<List<ShippingTemplates>> res=new ResponseVo<List<ShippingTemplates>>();
		try{
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("storeId", storeId);
			List<ShippingTemplates> list = shippingTemplatesService.getList(map);
			res.setResult(list);
		} catch(Exception e) {
			log.error("msg1=异常信息,{}", e);
		}
		return res;
	}


}